﻿//双击事件
function CustomDbClick() {
    parent.closeWin(); //去掉双击功能
}

//查看明细
var fnLinkSolutionItem = function (elCell, oRecord, oColumn, sData) {
    //debugger;
    elCell.innerHTML = "<a href=\"#\" onclick=\"javascript:fnSolutionItem('" + oRecord.getData("SolutionID") + "','" + sData + "');\">" + sData + "</a>";
};

//打开链接
var fnSolutionItem = function (solutionID, solutionName) {
    var pagetitle = "查看考核方案【" + solutionName + "】";
    parent._employeeTitle = pagetitle;
    parent.addTabs(pagetitle, encodeURI("../Extend/Edit.aspx?r=" + Math.random() + "&entity=ExaminationSolution&fun=view" + "&id=" + solutionID));
    parent.NeedRefreshPage = this;
}

//设置考核角色
var fnSelectRole = function () {
    var recordID = myDataTable.getSelectedRows()[0];
    record = myDataTable.getRecord(recordID);
    if (record == null) {
        alert("请选择一条记录");
        return;
    }
    var objectID = record.getData(const_entityID);
    var objectEmpName = record._oData["EmpName"];
    var objectEmpID = record._oData["EmployeeID"];
    var objectEmpCode = record._oData["EmployeeCode"];
    document.getElementById("EditUIWindow").src = "../EHR/hrSetExaminationRole.aspx?objectID=" + objectID + "&objectEmpID=" + objectEmpID + "&objectEmpName=" + objectEmpName + "&objectEmpCode=" + objectEmpCode;
    SetDWH(800, 400, YAHOO.example.container.dialog1);
    YAHOO.example.container.dialog1.show();
}

//批量设置考核角色
var fnBatchSelectRole = function () {
    var list = this.mDataTable.getRecordSet()._records;
    var elist = [];
    dl = [];
    for (var i = 0; i < list.length; i++) {
        //this.getRecordSet()._records[0]._oData["BarItem"]
        if (list[i]._oData["iSun_Selected"] == true) {
            elist.push(list[i]._oData[const_entityID]);
            dl.push(list[i]._sId); //获取行ID；
        }
    }
    if (elist.length > 0) {
        document.getElementById("EditUIWindow").src = "../EHR/hrSetBathExaminationRole.aspx?objectIDs=" + elist.join(",");
        SetDWH(800, 400, YAHOO.example.container.dialog1);
        YAHOO.example.container.dialog1.show();
    }
    else {
        alert("请至少选择一条记录！")
        return;
    }
}
